﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace Models
{
    public class Register
    {
        public static bool isReg = false;
        public static void GetLevel()
        {
            string ser = "";
            string code = "";

            XmlDocument xd = new XmlDocument();
            xd.Load("config.xml");
            XmlNode conn = xd.DocumentElement;

            foreach(XmlNode node in conn.ChildNodes)
            {
                switch (node.Name)
                {
                    case "server":
                        ser = node.InnerText;
                        break;
                    case "code":
                        code = node.InnerText;
                        break;
                    default:
                        break;
                }
            }

            if (Encrypt.DecryptDES(code, Config.code).Equals(ser))
            {
                isReg = true;
            }
        }
    }
}
